
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>心灵影院</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">

    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>


    <style type="text/css">
        /*a:link {*/
        /*text-decoration: none;*/
        /*}*/
        /*a:visited {*/
        /*text-decoration: none;*/
        /*}*/
        a:hover {
            text-decoration: none;  color:#FFAA33;
        }
        tab-item:active {
            color: #FFAA33;
        }

        .theme-dark .content{
            background-color: #181b20;
        }



        .bar-nav.theme-dark, .bar-tab.theme-dark, .theme-dark .bar-nav, .theme-dark .bar-tab{
            background-color: #333;
        }


        .search-input input{
            width: 80%;
            border-radius:1rem;
            background-color: #181b20;
            border: 0;
        }
        .bar input[type=search]{
            margin-left: 2rem;
        }
        .bar .title .icon{
            margin-left: 2rem;
        }
        .pull-right{
            padding-top: .5rem;
            color: #FFAA33;
        }
        .icon-left{
            color: #ffffff;
        }
        .list-block.media-list .item-inner{
            background-color: #181b20;
            padding-top: 0;
        }
        .theme-dark .list-block .item-title{
            color: #ffffff;
            font-size: 1rem;
        }
        .theme-dark .list-block .item-subtitle{
            padding-top: .5rem;
            padding-bottom: 1.3rem;
            color: #008C9E;
        }
        .list-block .item-inner:after{
            height: 0;
        }
        .title{
            width: 90%;
            margin-right: 0;
        }
        .search-input input{
            color: #008C9E;
        }
    </style>


</head>
<body class="theme-dark">
<div class="page">

    <header class="bar bar-nav">
        <a href="/movieIndex" class="icon icon-left pull-left"></a>
        <a href="javascript:void(0);" style="z-index: 10000" class=" pull-right"
           onclick="SearchVideos();">搜索
        </a>
        <h1 class="title">
            <div class="search-input">
                <label class="icon icon-search" for="searchText"></label>
                <input type="search" id='searchText' placeholder='输入关键字...'/>
            </div>
        </h1>

    </header>

    <div class="content">
        <!-- 这里是页面内容区 -->

        <div class="card">

            <div class="card-content">
                <div class="list-block media-list">
                    <ul id="ul_comment">

                    </ul>
                </div>
                <div id="div_commentfoot">

                </div>
            </div>

        </div>
    </div>
</div>

<script type='text/javascript' src='/js/mortise/comm.js' charset='utf-8'></script>
<script type="text/javascript">

    var filmObject = {
        pno: 1,
        pagesize: 6,
        allcount: -1,
        text:''
    }
    
    function SearchVideos() {
        var text=$('#searchText').val();
        if (!text){

            return;
        }
        filmObject.pno=1;
        filmObject.text=text;
        LoadSearchVideos();
    }
    function  LoadSearchVideos() {

        $('#div_commentfoot').html('');

        $.ajax({
            type: 'get',
            url:
            '/api/film/getfilmlist?name='+filmObject.text+'&filmtype=&pno='+filmObject.pno+'&pagesize=' +
            ''+filmObject.pagesize+'&allcount=-1',
            dataType: 'json',
            success: function(data){
                if (mortise_layout.ValidataResult(data)) {
                    //{"code":"OperateOk","errorMsg":"","result":{"list":[{"fId":"594cabc05bc42d07a0aa541a","fName":"一个钓鱼的故事","fFilmtype":"1000010100000000000","fYear":2016,"fCountry":12,"fKeyword":"一个钓鱼的故事","fPhoto":"http://119.10.70.142:9080/Images/upload/videoPhoto/595a87fe37ca1d108069af15.png","fPhotow":"http://101.201.122.79:8083/Images/upload/videoPhoto/596adca774c36b070e69ec8e.jpg","fDirector":"Matt Birman","fPerformer":"Eddie McClintock, Jayne Heitmeyer, Jordyn Negri ","fShowtime":"2016-12-12","fScore":0.0,"fPricetagid":"0","fPricetagname":"免费电影","fIntime":"2017-06-23 14:20:23","fShow":1,"fLookct":0,"fMakelookct":11,"fGoodct":0,"fMakegoodct":12,"fCollect":2,"fMakecollect":13,"fPlayct":132,"fMakepalyct":15,"fSharect":0,"fMakesharect":null,"fBuyct":0,"fCommentct":22,"fSourceurl":null,"fCountryname":"加拿大","fFilmtypename":"喜剧/剧情/奇幻","fImpression":"印象"},{"fId":"5930e4cd1c886e2dc0d45342","fName":"末世迷踪：下一代","fFilmtype":"0000000100000000000","fYear":2016,"fCountry":4,"fKeyword":"末世迷踪：下一代","fPhoto":"http://119.10.70.142:9080/Images/upload/videoPhoto/595a88f137ca1d108069af17.png","fPhotow":"http://101.201.122.79:8083/Images/upload/videoPhoto/596adcc774c36b070e69ec90.jpg","fDirector":"Larry A. McLean","fPerformer":" Amber Frank, Mason Dye, Dylan Sprayberry","fShowtime":"2017-06-02","fScore":0.0,"fPricetagid":"0","fPricetagname":"免费电影","fIntime":"2017-06-02 12:08:34","fShow":1,"fLookct":1,"fMakelookct":15,"fGoodct":2,"fMakegoodct":25,"fCollect":2,"fMakecollect":0,"fPlayct":17,"fMakepalyct":5,"fSharect":1,"fMakesharect":null,"fBuyct":0,"fCommentct":4,"fSourceurl":null,"fCountryname":"美国","fFilmtypename":"奇幻","fImpression":null},{"fId":"594c95065bc42d07a03f1fac","fName":"大婴儿","fFilmtype":"1100010000000000000","fYear":2015,"fCountry":4,"fKeyword":"大婴儿","fPhoto":"http://119.10.70.142:9080/Images/upload/videoPhoto/595a887337ca1d108069af16.png","fPhotow":"http://101.201.122.79:8083/Images/upload/videoPhoto/596adcb874c36b070e69ec8f.jpg","fDirector":"Stephen Langford","fPerformer":"Maureen McCormick, Andrew Lawrence, Ken Davitian","fShowtime":"2015-12-12","fScore":0.0,"fPricetagid":"1","fPricetagname":"2元电影","fIntime":"2017-06-23 12:43:35","fShow":1,"fLookct":0,"fMakelookct":11,"fGoodct":0,"fMakegoodct":12,"fCollect":1,"fMakecollect":13,"fPlayct":11,"fMakepalyct":15,"fSharect":0,"fMakesharect":null,"fBuyct":0,"fCommentct":4,"fSourceurl":null,"fCountryname":"美国","fFilmtypename":"喜剧/爱情/剧情","fImpression":"印象"},{"fId":"594cacc75bc42d07a0aa541b","fName":"正义","fFilmtype":"1100000000000000000","fYear":2016,"fCountry":4,"fKeyword":"正义","fPhoto":"http://119.10.70.142:9080/Images/upload/videoPhoto/595a87a137ca1d108069af14.png","fPhotow":"http://101.201.122.79:8083/Images/upload/videoPhoto/596adc9d74c36b070e69ec8d.jpg","fDirector":"Richard Gabai","fPerformer":" Stephen Lang, Jackson Rathbone, Jamie-Lynn Sigler ","fShowtime":"2016-12-12","fScore":0.0,"fPricetagid":"0","fPricetagname":"免费电影","fIntime":"2017-06-23 14:24:45","fShow":1,"fLookct":0,"fMakelookct":11,"fGoodct":0,"fMakegoodct":12,"fCollect":0,"fMakecollect":13,"fPlayct":4,"fMakepalyct":15,"fSharect":0,"fMakesharect":null,"fBuyct":0,"fCommentct":0,"fSourceurl":null,"fCountryname":"美国","fFilmtypename":"喜剧/爱情","fImpression":"印象"}]},"allcount":0}
                    var videoList = data.result.list;
                    var dataCount=data.result.count;

                    if (videoList && videoList.length > 0) {
                        var _html = '';
                        $.each(videoList,function(index,item){
                            _html +=
                                '<li class="item-content" onclick="GoToVideoInfo(\''+item.fId+'\')">'+
                                '<div class="item-media">'+
                                '<img src="'+item.fPhoto+'" width="100">'+
                                '</div>'+
                                '<div class="item-inner">'+
                                '<div class="item-title-row">'+
                                ' <div class="item-title">'+item.fName+'</div>'+
                                ' </div>'+
                                '  <div class="item-subtitle">'+item.fCountryname+item.fYear+'-'+item.fFilmtypename+'</div>'+
                                '   <div class="item-subtitle">'+item.fKeyword+'</div>'+
                                '</div>'+
                                '</li>';
                        });


                        if(filmObject.pno==1){
                            $('#ul_comment').html(_html);
                        }
                        else{
                            $('#ul_comment').append(_html);
                        }

                        if (dataCount>( filmObject.pno)* filmObject.pagesize){
                            $('#div_commentfoot').html('<span style="cursor:pointer" onclick="loadMore()">查看更多...</span>');
                        }
                        else{
                            //over
                            $('#div_commentfoot').html('<span style="cursor:pointer">没有数据了...</span>');
                        }

                    }
                    else{
                        $('#ul_comment').html('没有数据了！');
                    }

                }
            }
        });

    }
    function loadMore() {
        filmObject.pno++;
        LoadSearchVideos();
    }
</script>
</body>
</html>